package com.orhon.smartcampus.modules.systemctl.fetcher;

import com.orhon.smartcampus.modules.systemctl.mutation.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import graphql.schema.idl.RuntimeWiring;

@Component
public class SystemCtlFetchersLoader {

   @Autowired
   DepartmentUsersRecordsFetcher  departmentUsersRecordsFetcher;

   @Autowired
    UsersNotUnassignedDepartmentFetcher usersNotUnassignedDepartmentFetcher;

	@Autowired
	WidgetFetcher widgetFetcher;
	
	@Autowired
	WidgetsFetcher widgetsFetcher;
	
    @Autowired
    MenuFetcher menuFetcher;
    
    @Autowired
    MenusFetcher menusFetcher;

    @Autowired
    ModulesFetcher modulesFetcher;

    @Autowired
    ModuleFetcher moduleFetcher;

    @Autowired
    DepartmentsFetcher departmentsFetcher;

    @Autowired
    DutiesFetcher dutiesFetcher;

    @Autowired
    OperationsFetcher operationsFetcher;

    @Autowired
    SchoolsettingsFetcher schoolsettingsFetcher;

    @Autowired
    SchoolsettingFetcher schoolsettingFetcher;

    @Autowired
    DepartmentUsersFetcher departmentUsersFetcher;

    @Autowired
    VersionManagementsFetcher versionManagementsFetcher;

    @Autowired
    VersionManagementFetcher versionManagementFetcher;

    @Autowired
    ApisFetcher apisFetcher;
    @Autowired
    AddApiMutation addApiMutation;
    @Autowired
    DeleteApiMutation deleteApiMutation;

    @Autowired
    AddModulesMutation addModulesMutation;

    @Autowired
    DeleteModulesMutation deleteModulesMutation;

    @Autowired
    AddMenusMutation addMenusMutation;

    @Autowired
    DeleteMenusMutation deleteMenusMutation;

    @Autowired
    AddWidgetsMutation addWidgetsMutation;

    @Autowired
    DeleteWidgetsMutation deleteWidgetsMutation;

    @Autowired
    AddOperationMutation addOperationMutation;

    @Autowired
    DeleteOperationMutation deleteOperationMutation;

    @Autowired
    AddDutyMutation addDutyMutation;

    @Autowired
    DeleteDutyMutation deleteDutyMutation;

    @Autowired
    AddSchoolSettingsMutation addSchoolSettingsMutation;

    @Autowired
    DeleteSchoolSettingsMutation deleteSchoolSettingsMutation;

    @Autowired
    AddDepartmentMutation addDepartmentMutation;

    @Autowired
    DeleteDepartmentMutation deleteDepartmentMutation;

    @Autowired
    AddSetDepartmentUserRecordMutation addSetDepartmentUserRecordMutation;

    @Autowired
    DeleteSetDepartmentUserRecordMutation deleteSetDepartmentUserRecordMutation;

    @Autowired
    DeleteDepartmentUserMutation deleteDepartmentUserMutation;

    @Autowired
    AddDepartmentDutyOperationMutation addDepartmentDutyOperationMutation;

    @Autowired
    DeleteDepartmentDutyOperationMutation deleteDepartmentDutyOperationMutation;

    @Autowired
    AddUsersOperationMutation addUsersOperationMutation;
    @Autowired
    OperAndDeparAndDutyFetcher operAndDeparAndDutyFetcher;
    
    @Autowired
    OperationApisFetcher operationApisFetcher; 
    @Autowired
    AddOperationApiMutation addOperationApiMutation;
    @Autowired
    DeleteOperationApiMutation deleteOperationApiMutation;

    @Autowired
    AddVersionManagementMutation addVersionManagementMutation;
    
    @Autowired
    OperationUsersRecordFetcher operationUsersRecordFetcher; 

    @Autowired
    DeleteUsersOperationMutation deleteUsersOperationMutation;
    public void LoadFetchers(RuntimeWiring.Builder builder){
        builder.type("Query" , t -> t.dataFetcher("UsersNotUnassignedDepartment",this.usersNotUnassignedDepartmentFetcher)) ;
        builder.type("Query" , t -> t.dataFetcher("OperDeparAndDuty",this.operAndDeparAndDutyFetcher)) ;
    	builder.type("Query" , t -> t.dataFetcher("departmentUsersRecord",this.departmentUsersRecordsFetcher)) ;
    	builder.type("Query" , t -> t.dataFetcher("Widget",this.widgetFetcher)) ;
    	builder.type("Query" , t -> t.dataFetcher("Widgets",this.widgetsFetcher)) ;
        builder.type("Query" , t -> t.dataFetcher("Menu",this.menuFetcher)) ;
        builder.type("Query" , t -> t.dataFetcher("Menus",this.menusFetcher)) ;
        builder.type("Query" , t -> t.dataFetcher("Modules",this.modulesFetcher)) ;
        builder.type("Query" , t -> t.dataFetcher("Module",this.moduleFetcher)) ;
        builder.type("Query" , t -> t.dataFetcher("Operations",this.operationsFetcher)) ;
        builder.type("Query" , t -> t.dataFetcher("Duties",this.dutiesFetcher)) ;
        builder.type("Query" , t -> t.dataFetcher("Departments",this.departmentsFetcher)) ;
//        builder.type("Query" , t -> t.dataFetcher("SchoolSettings",this.schoolsettingsFetcher)) ;
//        builder.type("Query" , t -> t.dataFetcher("SchoolSetting",this.schoolsettingFetcher)) ;
        builder.type("Query" , t -> t.dataFetcher("SchoolSettings",this.schoolsettingsFetcher)) ;
        builder.type("Query" , t -> t.dataFetcher("SchoolSetting",this.schoolsettingFetcher)) ;
        builder.type("Query" , t -> t.dataFetcher("DepartmentUsers",this.departmentUsersFetcher)) ;
        builder.type("Query" , t -> t.dataFetcher("VersionManagements",this.versionManagementsFetcher));
        builder.type("Query" , t -> t.dataFetcher("VersionManagement",this.versionManagementFetcher));
        
        builder.type("Query" , t -> t.dataFetcher("Apis",this.apisFetcher)) ;
        builder.type("Mutation" , t->t.dataFetcher("addApi" , addApiMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteApi" , deleteApiMutation));
        
        builder.type("Mutation" , t->t.dataFetcher("addModules" , addModulesMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteModules" , deleteModulesMutation));
        builder.type("Mutation" , t->t.dataFetcher("addMenus" , addMenusMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteMenus" , deleteMenusMutation));
        builder.type("Mutation" , t->t.dataFetcher("addWidgets" , addWidgetsMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteWidgets" , deleteWidgetsMutation));
        builder.type("Mutation" , t->t.dataFetcher("addOperation" , addOperationMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteOperation" , deleteOperationMutation));
        builder.type("Mutation" , t->t.dataFetcher("addDuty" , addDutyMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteDuty" , deleteDutyMutation));
        builder.type("Mutation" , t->t.dataFetcher("addSchoolSettings" , addSchoolSettingsMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteSchoolSettings" , deleteSchoolSettingsMutation));
        builder.type("Mutation" , t->t.dataFetcher("addDepartment" , addDepartmentMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteDepartment" , deleteDepartmentMutation));
        builder.type("Mutation" , t->t.dataFetcher("setDepartmentUserRecord" , addSetDepartmentUserRecordMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteDepartmentUserRecord" , deleteSetDepartmentUserRecordMutation));
        builder.type("Mutation" , t->t.dataFetcher("setDepartmentDutyOperation" , addDepartmentDutyOperationMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteDepartmentDutyOperation" , deleteDepartmentDutyOperationMutation));
        builder.type("Mutation" , t->t.dataFetcher("setUsersOperation" , addUsersOperationMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteUsersOperation" , deleteUsersOperationMutation));
        builder.type("Mutation" , t->t.dataFetcher("addOperationApi" , addOperationApiMutation));
        builder.type("Mutation" , t->t.dataFetcher("deleteOperationApi" , deleteOperationApiMutation));
        builder.type("Query" , t->t.dataFetcher("operationApis" , operationApisFetcher));
        
        builder.type("Query" , t->t.dataFetcher("schoolOperationUsers" , operationUsersRecordFetcher));

        builder.type("Mutation" , t->t.dataFetcher("deleteDepartmentUser" , deleteDepartmentUserMutation));

        builder.type("Mutation" , t->t.dataFetcher("addVersionManagement" , addVersionManagementMutation));

    }

}
